package com.kooison.idevice4u.bean;

public class ProductDetail {
	public enum PAGE_TYPE { SELECT, ITEM, RETAIL }
	
	private String product;
	private String region;
	private String color;
	private String size;
	private String url;
	private int status;
	private boolean isAvailable = false;
	private PAGE_TYPE pageType;
	private String price;
	private String data;
	
	/**
	 * @param product
	 * @param region
	 */
	public ProductDetail(String product, String region) {
		this.product = product;
		this.region = region;
	}
	
	/**
	 * @param product
	 * @param region
	 * @param color
	 * @param size
	 * @param url
	 * @param pageType
	 */
	public ProductDetail(String product, String region, String color, String size, String url, PAGE_TYPE pageType) {
		this.product = product;
		this.region = region;
		this.color = color;
		this.size = size;
		this.url = url;
		this.isAvailable = false;
		this.pageType = pageType;
	}
	/**
	 * @param product
	 * @param region
	 * @param color
	 * @param size
	 * @param url
	 * @param pageType
	 * @param data
	 */
	public ProductDetail(String product, String region, String color, String size, String url, PAGE_TYPE pageType, String data) {
		this.product = product;
		this.region = region;
		this.color = color;
		this.size = size;
		this.url = url;
		this.isAvailable = false;
		this.pageType = pageType;
		this.data = data;
	}
	public String getProduct() {
		return product;
	}
	public void setProduct(String product) {
		this.product = product;
	}
	public String getRegion() {
		return region;
	}
	public void setRegion(String region) {
		this.region = region;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public String getSize() {
		return size;
	}
	public void setSize(String size) {
		this.size = size;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public boolean isAvailable() {
		return isAvailable;
	}
	public void setAvailable(boolean isAvailable) {
		this.isAvailable = isAvailable;
	}
	public PAGE_TYPE getPageType() {
		return pageType;
	}
	public void setPageType(PAGE_TYPE pageType) {
		this.pageType = pageType;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	
	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getProductName() {
		String name = this.product.toUpperCase();
		if (this.color != null) name += " " + this.color.toUpperCase();
		if (this.size != null) name += " " + this.size.toUpperCase();
		name += " in " + this.region.toUpperCase();
		return name;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("CrawlerBean [color=").append(color).append(", data=").append(data).append(", isAvailable=").append(
				isAvailable).append(", pageType=").append(pageType).append(", price=").append(price).append(
				", product=").append(product).append(", region=").append(region).append(", size=").append(size).append(
				", status=").append(status).append(", url=").append(url).append("]");
		return builder.toString();
	}
}
